<template>
  <div class="full">
    <post-edit v-if="post.userId != null" :post="post" @onBack="onBack"/>
    <my-table v-else @setPostData="setPostData"/>
  </div>
</template>

<script lang="ts" setup>
import {provide, ref} from "vue";
import postEdit from "./post-edit.vue";
import myTable from "./my-table.vue";

let active: any = ref({});
provide("active", active);
let post: any = ref({
  row: false,
  isBack: true,
})
const setPostData = (data: object) => {
  post.value = data
  console.log(post)
}
const onBack = () => {
  post.value = {}
}

</script>

<style lang="scss" scoped>
.full {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  display: flex;
}
</style>